//
//  ViewController.m
//  静态库的应用
//
//  Created by 杨庆 on 16/1/16.
//  Copyright © 2016年 双元班. All rights reserved.
//

#import "ViewController.h"
#import "YQview.h"
#import "YQTools.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    //1. 添加工具类
    NSLog(@"%zd",[YQTools sumWithNum1:10 andNum2:10]);
    //2. 实现加载一定资源   放在bundle 中避免资源的重复
    UIImageView * imgV = [[UIImageView alloc]initWithFrame:CGRectMake(125, 100, 100, 100)];
    imgV.image = [YQTools loadLogo];
    [self.view addSubview:imgV];
    //3.封装视图
    YQview * view = [[YQview alloc]initWithFrame:CGRectMake(100, 300, 100, 100) andCompelete:^(NSString * msg){
//        UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"提示" message:msg delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
//        [alert show];
//        //注意的是 iOS 8的新特性之一是 UIAlertViewController = UIAlertView + UIAcitionSheet
//        UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"友情提示!" message:@"是否要保存图片到相册" preferredStyle:UIAlertControllerStyleActionSheet];
        //新的方法是比较复杂的;
        UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"提示" message:msg preferredStyle:UIAlertControllerStyleAlert];
        [alert addAction:[UIAlertAction actionWithTitle:@"否" style:UIAlertActionStyleCancel handler:nil]];
        [self presentViewController:alert animated:YES completion:nil];
    }];
    [self.view addSubview:view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
